package com.jxk.springcloud.controller;

import com.jxk.springcloud.entities.CommonResult;
import com.jxk.springcloud.entities.Payment;
import com.jxk.springcloud.service.PaymentFeignService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @ClassName : OrderFeignController  //类名
 * @Description :   //描述
 * @Author : jxk  //作者
 * @Date: 2020-09-06 09:29  //时间
 */
@RestController
public class OrderFeignController {

    @Resource
    private PaymentFeignService paymentFeignService;

    @GetMapping(value = "/consumer/payment/get/{id}")
    public CommonResult<Payment> getPaymentById(@PathVariable("id") Long id){
        return paymentFeignService.getPaymentById(id);
    }
    @GetMapping(value = "/consumer/payment/feign/timeout")
    public String paymentFeignTimeout(){
        //openfein 默认等待一秒钟 超过报错，可以手动设置
        return paymentFeignService.paymentFeignTimeout();
    }

}

